/**
 * 说明：
 * 创建人：pluto
 * 创建时间：2018/8/3
 */
var CommissionCtrl = function ($scope, CommissionService) {
    $scope.result = {list: [], page: {currentNo: 1, everyPage: 10}};
    $scope.param = {pageNum: 1, pageSize: 10};

    $scope.onPageChange = function () {
        $scope.param.pageNum = $scope.result.page.currentNo;
        loadData($scope.param);
    };

    var loadData = function (param) {
        CommissionService.list(param).then(function (res) {
            $scope.result = res;
        },function (error) {
            console.log(error)
        })
    };
    $scope.search = function () {
        $scope.param.pageNum = 1;
        loadData($scope.param);
    };
    loadData($scope.param);
};

angular.module('app.commission.controller',[])
    .controller('CommissionCtrl', CommissionCtrl);

